using System;
using System.Threading;
using System.Web.UI;

namespace ScottCateAjax2008.Lesson05
{
    public partial class C_UpdateProgress : Page
    {
        protected void Page_Load ( object sender, EventArgs e )
        {
        }

        protected void refreshButton_Click(object sender, EventArgs e)
        {
            this.UpdateTimeLabels();
        }

        protected void refreshButton200_Click(object sender, EventArgs e)
        {
            Thread.Sleep(2000);
            this.UpdateTimeLabels();
        }

        protected void refreshButton500_Click(object sender, EventArgs e)
        {
            Thread.Sleep(5000);
            this.UpdateTimeLabels();
        }

        private void UpdateTimeLabels()
        {
            this.RefreshBlueTimeLabel.Text =
                this.RefreshRedTimeLabel.Text = 
                DateTime.Now.ToLongTimeString();
        }
    }
}